<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>书籍信息</title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <link rel="stylesheet" href="${pageContext.request.contextPath }/dist/css/bootstrap.min.css" type="text/css"></link>
    <link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/ie10-viewport-bug-workaround.css" type="text/css"></link>
    <link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/justified-nav.css" type="text/css"></link>
    <script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/ie-emulation-modes-warning.js"></script>
    
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/jquery.pagination.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/css.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.pagination.min.js"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }
        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
</head>
<body>
<div class="container">
      <div class="masthead">
        <h3 class="text-muted">智能图书管理系统</h3>
        <nav>
          <ul class="nav nav-justified">
             <li class="active"><a href="<%=request.getContextPath()%>/looker/showOther">图书查询</a></li>
            <li><a href="<%=request.getContextPath()%>/looker/index">用户及管理员登录入口</a></li>
          </ul>
        </nav>
      </div>
    

 
 <div class="container">
 
 
  
   <form  method="post"align="center">
   <h2>本书的信息如下：</h2>
    <input type="hidden" name="bid" value="${book.id}" />
     <div class="container"  style="float:left; width:25%">   
     <img src="bookimg/${book.id}.jpg" style="width:200px;height:300px"/>
     </div>
     <div style="float:left; width:75%">   
    <table class="table table-bordered table-hover definewidth m10" >
        <tr>
        	
            <td width="10%" class="tableleft">书籍类别</td>
            <td><input type="text" name="sname" value="${book.sname}" disabled="disabled"/></td>
        </tr>
        <tr>
            <td class="tableleft">书籍名称</td>
            
            <td>
            
            <input type="text" name="bname" value="${book.bname}" disabled="disabled"/>
            </td>
        </tr>
        <tr>
            <td class="tableleft">作者</td>
            <td><input type="text" name="author" value="${book.author}" disabled="disabled"/></td>
        </tr>
        <tr>
            <td class="tableleft">出版社</td>
            <td><input type="text" name="birth" value="${book.birth}" disabled="disabled"/></td>
        </tr>
        <tr>
             <td class="tableleft">版本</td>
            <td><input type="text" name="edition" value="${book.edition}" disabled="disabled"/></td>
        </tr>
        <tr>
              <td class="tableleft">剩余数量</td>
            <td><input type="text" name="number" value="${book.number}" disabled="disabled"/></td>
        </tr>
        <tr>
            <td class="tableleft"></td>
            <td>
           <c:if test="${book.number>=0}">
           		<a type="button" class="btn btn-success" name="backid" id="backid" href="<%=request.getContextPath()%>/looker/showOther">返回列表</a>
           </c:if>
            
            </td>
        </tr>
    </table>
    </div>
  
</form>
<h3>读者评论</h3>
 <c:forEach items="${list}" var="book">
           <hr align=center width=100% color=#987cb9 SIZE=3 />
				<tr>
				  <td><a href="javascript:void(0)"  onclick="checkFunction()" style="font-size:20px">${book.userid}号用户</a></td>
					<td>
					 <div id="starRating">
                      <span class="photo">
                      <c:if test="${book.rating==1}">
                        <span><i class="halfhigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==2}">
                        <span><i class="high"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==3}">
                        <span><i class="high"></i></span>
                        <span><i class="halfhigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==4}">
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==5}">
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="halfhigh"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==6}">
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="nohigh"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==7}">
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="halfhigh"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==8}">
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="nohigh"></i></span>
                      </c:if>
                      <c:if test="${book.rating==9}">
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="halfhigh"></i></span>
                      </c:if>
                       <c:if test="${book.rating==10}">
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                        <span><i class="high"></i></span>
                      </c:if>
                       <a style="color:red; font-size:20px" >${book.rating}分</a>
                     </span>
                    </div>
                   </td>
					<td>
					 <h4>${book.comments}</h4><br/><a href="javascript:void(0)"  onclick="pinlunFunction()">评的好👍(${book.up})</a>  
					 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="pinlunFunction()">评的不客观👎(${book.down})</a>
					</td>
					
				</tr>
				
	</c:forEach>
</div>




 <!-- Site footer -->
      <footer class="footer" align="center">
        <a href="http://beian.miit.gov.cn/">鄂ICP备2021006740号-1</a>
        <div style="width:300px;margin:0 auto; padding:20px 0;">
		 		<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=42092102000053" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">
		 		<img src="../images/备案图标.png" style="float:left;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">鄂公网安备 42092102000053号</p></a>
		 	</div>
        <p>YanJiaDou &copy; 2020 版权所有</p>
      </footer>

</div>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
<script>
    $(function () {       
		$('#backid').click(function(){
				window.location.href="{:U('User/index')}";
		 });

    });
    
    function checkFunction(){
    	alert("您好，你目前是游客，无法查看其他用户信息，请您登陆后进行查看");
    }
    function pinlunFunction(){
    	alert("您好，你目前是游客，无法进行点赞或点踩，请您登陆后进行操作");
    }
</script>
